package com.gruuf.done.web;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.gruuf.done.repositories.TasksRepository;
import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport {

    protected TasksRepository repository;
    protected UserService userService;

    public BaseAction() {
        repository = new TasksRepository();
        userService = UserServiceFactory.getUserService();
    }

    protected boolean isUserLoggedIn() {
        return userService.isUserLoggedIn();
    }

    protected String getUserId() {
        return userService.getCurrentUser().getUserId();
    }

}
